export default class Store {
    
    // 某个字符串非空
    isNotEmpty = (s) => {
        return s && s.length > 0
    }

    // 某个字符串为空
    isEmpty = (s) => {
        return !this.isNotEmpty(s)
    }

    // 一系列字符串不是全为空
    isNotAllEmpty = (...args) => {
        for (let i = 0; i < args.length; i++) {
            if (args[i] && args[i].length > 0) {
                return true
            }
        }
        return false
    }

    // 一系列字符串全部不为空
    allIsNotEmpty = (...args) => {
        for (let i = 0; i < args.length; i++) {
            if (!this.isNotEmpty(args[i])) {
                return false
            }
        }
        return true
    }

    // 判断某个source字符串是否包含另一个target字符串
    contains = (source, target) => {
        if (this.isNotEmpty(target)) {
            return source.indexOf(target) != -1
        }
        return false
    }
}